<template>
    <h3>上周值日生</h3>
    <el-input v-model="lastWeekDuty" placeholder="上周值日生姓名" clearable />
    <h3>本周值日生</h3>
    <el-input v-model="thisWeekDuty" placeholder="本周值日生姓名" clearable />
    <p/>
</template>

<script>
export default {
  name: "DeviceCheck_Login",
  data() {
    return {
      lastWeekDuty: "",
      thisWeekDuty: "",
      next: "/",
      disable: true,
    }
  },
  mounted() {
    if(window.localStorage.time){
      if((new Date()).valueOf() - window.localStorage.time > 1000 * 60 * 60 * 24 * 7){
        window.localStorage.clear()
        window.localStorage.time = (new Date()).valueOf();
      }
    }else{
      window.localStorage.time = (new Date()).valueOf();
    }
    if(window.localStorage.lastWeek){
      this.lastWeekDuty = window.localStorage.lastWeek
    }
    if (window.localStorage.thisWeek) {
      this.thisWeekDuty = window.localStorage.thisWeek
    }
  },
  watch:{
    lastWeekDuty: function(newValue) {
      window.localStorage.lastWeek = newValue
    },
    thisWeekDuty: function (newValue) {
      window.localStorage.thisWeek = newValue
    }
  }
}
</script>

<style scoped>

</style>